<!DOCTYPE html>
<html>
	<head>

		<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no" charset="UTF-8">
		<title></title>


		<script type="text/javascript" src="static/js/d3.min.js" ></script>
		<script type="text/javascript"  src="static/js/jquery-1.10.2.min.js"></script>
		<script type="text/javascript" src="static/js/strucMap.min.js" ></script>
		<link rel="stylesheet" href="static/css/strucMap.min.css" />
		<link rel="icon" href="static/万达信息.ico" type="image/x-icon" />
		<link rel="shortcut icon" href="static/万达信息.ico" type="image/x-icon" />
		 <style type="text/css">
            html,body{
                height:100%;
            }
        </style>

	</head>
	<body background="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1598875612019&di=fa3ff0eef7942b1a597786fbf758cdc7&imgtype=0&src=http%3A%2F%2Fwww.pptbz.com%2Fpptpic%2FUploadFiles_6909%2F201411%2F2014111911312157.jpg" style=" background-repeat:no-repeat ;background-size:100% 100%;background-attachment: fixed;">

		<div id="title" style="padding:0px" ></div>
		<div id="topomap" style="margin: auto;margin-top:2%;" ></div>
		<script type="text/javascript">
				function getData(tp) {
    var ind;
    $.ajax({
        type:'get',
        url:'/view',
        cache: false,
        async: false,
        success: function(data) {
        var  obj1 = JSON.parse(data);
        nodesJson = obj1.nodesJson;
        linksJson = obj1.linksJson;
        console.log(obj1);
        data_name = $("#title").append($("<span></span>").text(obj1.name));
            ind = {"nodesJson":nodesJson,"linksJson":linksJson};
        }, error: function(data) {
            ind = {"":""};
        }
    });
    console.log(ind);
    return ind;
}
			var nodePX = 0;
			var nodePY = 0;
	        var options = {
	        	selector:"#topomap",
	        	width: 1440,//实际展开图宽度
	            height: 1440,//实际展开图高度
	            lineLength:100,
//	            textColor:"#000",
//	            textFontFamily:'',
	            nodesClick: function(t) {
					//if(t.index==0) t.fixed=1;//判断如果是第一级，移动后就将它固定
					t.fixed = 1;
					console.log(t);
					var nodeX = JSON.parse(JSON.stringify(t.x));
					var nodeY = JSON.parse(JSON.stringify(t.y));
					//xy都没有变，说明没有拖动
					if((nodeX == nodePX)&&(nodeY == nodePY)){
						console.info("跳页面啦~~~~~~");
					}
				},
				nodesDragstart:function(t) {
					nodePX = JSON.parse(JSON.stringify(t.x));
					nodePY = JSON.parse(JSON.stringify(t.y));
					//console.log("移动开始",JSON.parse(JSON.stringify(t.x)),JSON.parse(JSON.stringify(t.y)));
				}
				};
				var da = getData();
				var nodesJson =da["nodesJson"];
				 var linksJson =da["linksJson"];
	            loadMap(options, nodesJson, linksJson);
		</script>
	</body>
</html>
